VERSION  --referenced-save-only 0.5
FROM alpine:3.15

mysubimage:
    WORKDIR /data
    RUN echo mysubimage > mysubimage
    SAVE IMAGE mysubimage:test

myimage:
    FROM +mysubimage
    RUN echo myimage > myimage
    SAVE IMAGE myimage:test
